package com.lh;

import com.lh.service.DemoService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Consumer1 {
    public static void main(String[] args) throws Exception {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[]{"consumer1.xml"});
        context.start();
        DemoService productService = (DemoService) context.getBean("productService");// 获取远程服务代理
        String result = productService.hello("消费");//远程调用服务提供提供的方法
        System.out.println(result);//打印结果

    }


}
